if(isOrcidTokenInSession != null && isOrcidTokenInSession === "Y"){
	
  $(document).on('click','#headerResetPassword',function(event){
    event.preventDefault();
    if(isLoginPage != "Y")
    {
	  if(confirm(passwordAlert))
      {
	    setField(IParameterName.NEXT_PAGE, resetPasswordPage);
	    document.forms[0].submit();
	  }
    }
    else
    {
	  $('#orcid_modal_to_reset_password').modal('show');
    }
  });

  $(document).on('click','#headerBredcrumbsLoginLink', function(event){
	var elementExists = document.getElementsByName('XIK_TAGACT');
	if(typeof(elementExists) != 'undefined' && elementExists != null)
	{
	  document.getElementsByName('XIK_TAGACT')[0].disabled = true;
	}
	setField('XIK_PREACT', orcidLoginRedirect);
    setField(IParameterName.NEXT_PAGE, loginPage);
    setField('ORCID_IS_CANCELLED', 'Y');
  });

  $(document).on('click','#reset_password', function(event){
	event.preventDefault();
	$('#orcid_modal_to_reset_password').modal('show');
  });
	
  $(document).on('click','#reset_password_link', function(event){
    event.preventDefault();	
    $('#orcid_modal_to_reset_password').modal('show');
  });
	
  $(document).on('click','#headerBreadcrumbsCreateAccount', function(event){
    event.preventDefault();
    setField(IParameterName.PRE_ACTION, createAccountAction);
    setField(IParameterName.NEXT_PAGE, createAccountPage);
    setField(IParameterName.ORCID_ACTION_TYPE,orcidActionType);
    orcidToken();
    document.forms[0].submit();
  });

  $(document).on('click','#createAccount', function(event){
	setField(IParameterName.ORCID_ACTION_TYPE,orcidActionType);
    orcidToken();
  });
}

$(document).on('click','#cancel_orcid_linking', function(event){
  $('#cancel_orcid_link_modal').modal('show');
});

function orcidToken(){
  setField('IS_ORCID_TOKEN_IN_SESSION',isOrcidTokenInSession);
  setField(IParameterName.ORCID,orcid);
  setField(IParameterName.ORCID_ACCESS_TOKEN,orcidAccToken);
  setField(IParameterName.ORCID_REFRESH_TOKEN,orcidRefreshToken);
  setField(IParameterName.ORCID_SCOPE,orcidScope);
  setField(IParameterName.ORCID_EXPIRES_IN,orcidExpiresIn);
  setField(IParameterName.ORCID_TOKEN_TYPE,orcidTokenType);
}

$(document).on('click','#displayScope', function(event){
	$('#orcid_display_scopes').modal('show');
});